From: Florian Müllner Date: Tue, 25 Jan 2022 14:47:23 +0000 (+0100) Subject: style: Handle sections in submenus X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~203 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c256ca443ef70f1c69a62afebeb33a6bbe48c38c;p=gnome-shell.git style: Handle sections in submenus If a menu item in a submenu is part of a section, it should have rounded bottom corners if both the item and the section are the last child of its respective parent. To express that, add a new .popup-menu-section class and use that to undo/redo the rounding for items inside a section. It would be possible to do without a new class with a selector like > StBoxLayout > .popup-menu-item:last-child:hover, :last-child > .popup-menu-item:last-child:hover but that's hardly better with its heavy reliance on implementation details. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4940 Part-of: --- diff --git a/data/theme/gnome-shell-sass/widgets/_popovers.scss b/data/theme/gnome-shell-sass/widgets/_popovers.scss index f523ec6dd..3ddca4f24 100644 --- a/data/theme/gnome-shell-sass/widgets/_popovers.scss +++ b/data/theme/gnome-shell-sass/widgets/_popovers.scss @@ -139,6 +139,13 @@ border-radius: 0 0 $base_border_radius $base_border_radius; } } + + .popup-menu-section { + .popup-menu-item:last-child:hover { border-radius: 0 } + &:last-child .popup-menu-item:last-child:hover { + border-radius: 0 0 $base_border_radius $base_border_radius; + } + } } // container for radio and check boxes diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index f9c3df0bf..0cb4970c1 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1165,6 +1165,8 @@ var PopupMenuSection = class extends PopupMenuBase { this.actor = this.box; this.actor._delegate = this; this.isOpen = true; + + this.actor.add_style_class_name('popup-menu-section'); } // deliberately ignore any attempt to open() or close(), but emit the